#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int main()
{
	int a1 = 0, a2 = 0;
	char s1[101] = { 0 };
	char s2[101] = { 0 };
	int n = 0;
	scanf("%d", &n);
	while (n)
	{
		scanf("%s %s", s1, s2);
		if (strcmp(s1, "Rock") == 0)
		{
			a1 = 1;
		}
		else if (strcmp(s1, "Scissors") == 0)
		{
			a1 = 2;
		}
		else
			a1 = 3;
		if (strcmp(s2, "Rock") == 0)
		{
			a2 = 1;
		}
		else if (strcmp(s2, "Scissors") == 0)
		{
			a2 = 2;
		}
		else
			a2 = 3;
		if (a1 == a2)
			printf("Tie\n");
		else if ((a1 + 1 == a2) || (a1 == 3 && a2 == 1))
			printf("Player1\n");
		else
			printf("Player2\n");
		n--;
	}
	return 0;
}